<?php

namespace Models;

class Post extends \Phalcon\Mvc\Model
{

    /**
     *
     * @var integer
     */
    public $id;
     
    /**
     *
     * @var string
     */
    public $name;
     
    /**
     *
     * @var string
     */
    public $content;
     
    /**
     *
     * @var integer
     */
    public $isEnabled;
     
    /**
     * Independent Column Mapping.
     */
    public function columnMap()
    {
        return array(
            'id' => 'id', 
            'name' => 'name', 
            'content' => 'content', 
            'isEnabled' => 'isEnabled'
        );
    }

    public function initialize()
    {
        $this->hasMany('id', 'Models\UserPost', 'idPost', array(
            'alias' => 'userPost'
        ));
    }

}
